package com.mvp.shq.washer.ui.contactUs;

import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.jaeger.library.StatusBarUtil;
import com.mvp.shq.washer.R;
import com.mvp.shq.washer.base.BaseActivity;
import com.mvp.shq.washer.utils.JumpUtil;
import com.mvp.shq.washer.view.widget.CustomDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ContactUsActivity extends BaseActivity<ContactUsPresenter, ContactUsModel> implements ContactUsConstract.View {

    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.title)
    TextView title;
    private CustomDialog dialog;

    @Override
    public int getLayoutId() {
        return R.layout.activity_contact_us;
    }

    @Override
    public void initView() {
        StatusBarUtil.setColor(this, ContextCompat.getColor(context,R.color.white),0);
    }


    @OnClick({R.id.back, R.id.arl_seriver, R.id.arl_refund, R.id.arl_feedback, R.id.arl_aboutus})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.arl_seriver:
                if (dialog == null){
                    CustomDialog.Builder builder = new CustomDialog.Builder(context);
                    dialog = builder.setMessage("客服热线:"+getResources().getString(R.string.phone_no))
                            .setPositiveButton("取消", new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    dialog.dismiss();
                                }
                            })
                            .setNegativeButton("拨打", new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    JumpUtil.call(context,getResources().getString(R.string.phone_no));
                                }
                            }).createTwoButtonDialog();
                }
                dialog.show();
                break;
            case R.id.arl_refund:
                break;
            case R.id.arl_feedback:
                break;
            case R.id.arl_aboutus:
                JumpUtil.toAboutUs(context);
                break;
        }
    }
}
